import http from '../util/request.js'


export default{
    captcha: ()=>{
        return http({
            url:'/api/login/captcha',
            method:'get'
        })
    },
    userLogin: (obj)=>{
        return http({
            url:'/api/login/dologin',
            method:'post',
            params: {
                loginType: 'user',
                phone: obj.phone,
                password: obj.password,
                captcha: obj.captcha,
                key: obj.key
            }
        })
    },
    adminLogin: (obj)=>{
        return http({
            url:'/api/login/dologin',
            method:'post',
            params: {
                loginType: 'admin',
                adminAccount: obj.adminAccount,
                password: obj.password
            }
        })
    },
    logininfo: ()=>{
        return http({
            url:'/api/login/logininfo',
            method:'get'
        })
    },
    register: (obj)=>{
        return http({
            url:'/api/login/register',
            method:'post',
            data: obj
        })
    },
    resetPassword: (obj)=>{
        return http({
            url:'/api/login/resetPassword',
            method:'post',
            params: obj
        })
    }
}